import sys
import os
path = os.path.abspath(os.curdir)
print(path)
path = str(path)
newPath = path + '\\LanguageToCode'
sys.path.append(newPath)
import AutoCoder

fs = open('./LanguageToCode/Resources/TestCase', 'r', encoding='utf-8')
strs = []
for line in fs.readlines():
    if line[-1] == '\n':
        line = line[0:-1]
    strs.append(line)
fs.close()
ans = AutoCoder.AutoCode(strs)
for sentence in ans:
    for i in range(sentence.len):
        clause = sentence.get(i)
        words = []
        for j in range(clause.len):
            token = clause.get(j)
            words.append(str(token.tag)[4:] + ' ')
        print(clause.clauseType, words)
    print('\n')
